﻿<!DOCTYPE html>
<html lang="zh">

<head resource>
    <meta charset="utf-8">
    <title>账号管理</title>
    <include file="../inc/meta.inc" />

</head>

<body>
    <div id="vapp" v-cloak>
        <div class="toolsbar">
            <btngroup show="修改,删除,批量删除,导出" ref='btngroup' @delete="deleteData" @output="output" @bathdelete="bathdel"
                path="AccountModify" :disabled="loading || loadingdel" width="600" height="600" :selects='selects'
                idkey='Ac_ID' table="datatables"></btngroup>
            <query_panel :model="form" :loading="loading" width="400px" @search="handleCurrentChange(1)"
                :disabled="loading || loadingdel">
                <el-form-item label="姓名">
                    <el-input v-model="form.name" placeholder="姓名" clearable style="width:200px"></el-input>
                </el-form-item>
                <el-form-item label="电话">
                    <el-input v-model="form.phone" placeholder="电话" clearable style="width:200px"></el-input>
                </el-form-item>
                <template v-slot:more>
                    <el-form-item label="机构">
                        <el-select v-model="form.orgid" placeholder="所有机构" clearable style="width: 300px;">
                            <el-option class="organs_option" v-for="(item,index) in organs" :key="item.Org_ID"
                                :label="item.Org_PlatformName" :value="item.Org_ID">
                                <div>
                                    <span>{{index+1}}.</span>
                                    <span> {{ item.Org_PlatformName }}</span>
                                </div>
                                <div style="color: #8492a6; font-size: 13px">{{ item.Org_Name }}</div>
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="账号">
                        <el-input v-model="form.acc" placeholder="账号" clearable style="width:200px"></el-input>
                    </el-form-item>
                    <el-form-item label="身份证">
                        <el-input v-model="form.idcard" placeholder="身份证" clearable style="width:300px"></el-input>
                    </el-form-item>
                </template>
            </query_panel>

        </div>
        <template>
            <el-table ref="datatables" :stripe="true" :data="accounts" tooltip-effect="dark" style="width: 100%"
                @selection-change="val=>selects=val" @row-dblclick="rowdblclick" v-loading="loading || loadingdel"
                element-loading-text="正在处理中..." element-loading-spinner="el-icon-loading" :height="tableHeight"
                element-loading-background="rgba(255, 255, 255, 0.8)"
                :row-class-name="data=>{return data.row.Ac_IsUse ? 'enable' : 'disabled';}">
                <el-table-column type="selection" width="35">
                </el-table-column>
                <el-table-column type="index" width="50" align="center">
                    <template slot-scope="scope">
                        <span>{{(form.index - 1) * form.size + scope.$index + 1}}</span>
                    </template>
                </el-table-column>
                <el-table-column label="姓名" width="120">
                    <template slot-scope="scope">
                        <icon :man="scope.row.Ac_Sex!=2" :woman="scope.row.Ac_Sex==2" class="large">
                            <span v-html='showsearch(scope.row.Ac_Name,form.name)' v-if="scope.row.Ac_Name!=''"
                                @dblclick.stop="copytext(scope.row.Ac_Name)"></span>
                            <span v-else class="noname">(没有名字)</span>
                        </icon>
                    </template>
                </el-table-column>
                <el-table-column label="账号">
                    <template slot-scope="scope">
                        <icon v-html='showsearch(scope.row.Ac_AccName,form.acc)' :teacher="scope.row.Ac_IsTeacher"
                            @dblclick.stop="copytext(scope.row.Ac_AccName)" :title="scope.row.Ac_IsTeacher ? '教师' : ''">
                        </icon>
                    </template>
                </el-table-column>
                <el-table-column label="电话" width="100">
                    <template slot-scope="scope">
                        <span v-html='showsearch(showmobi(scope.row),form.phone)'
                            @dblclick.stop="copytext(showmobi(scope.row))"></span>
                    </template>
                </el-table-column>
                <el-table-column label="身份证" width="160">
                    <template slot-scope="scope">
                        <span v-html='showsearch(scope.row.Ac_IDCardNumber,form.idcard)'
                            @dblclick.stop="copytext(scope.row.Ac_IDCardNumber)"></span>

                    </template>
                </el-table-column>
                <el-table-column label="资金" width="120">
                    <template slot-scope="scope">
                        <el-tooltip content="增加或减扣金额" placement="bottom" effect="light">
                            <icon money @click="moneyHandle(scope.row)">{{scope.row.Ac_Money}}</icon>
                        </el-tooltip>
                    </template>
                </el-table-column>
                <el-table-column label="启用" width="80" align="center">
                    <template slot-scope="scope">
                        <span class="el-icon-loading" v-show="loadingid==scope.row.Ac_ID"></span>
                        <el-switch v-model="scope.row.Ac_IsUse" @change="changeUse(scope.row)"
                            v-show="loadingid!=scope.row.Ac_ID">
                        </el-switch>
                    </template>
                </el-table-column>

                <el-table-column label="操作" show-overflow-tooltip width="80" align="center">
                    <template slot-scope="scope">
                        <el-dropdown>
                            <span class="el-dropdown-link">
                                管理<i class="el-icon-arrow-down el-icon--right"></i>
                            </span>
                            <el-dropdown-menu slot="dropdown">
                                <el-dropdown-item @click.native="capitalRecords(scope.row)">
                                    <span icon="&#xe749">资金流水</span>
                                </el-dropdown-item>                               
                                <el-divider></el-divider>
                                <el-dropdown-item divided type="danger" icon="el-icon-edit" style="color:#409EFF"
                                    @click.native='$refs.btngroup.modify(scope.row.Ac_ID)'> 修改
                                </el-dropdown-item>
                                <el-dropdown-item type="danger" icon="el-icon-delete" style="color:#F56C6C"
                                    @click.native='$refs.btngroup.delete(scope.row.Ac_ID)'> 删除
                                </el-dropdown-item>
                            </el-dropdown-menu>
                        </el-dropdown>
                    </template>



                </el-table-column>
            </el-table>

        </template>
        <div id="pager-box">
            <el-pagination v-on:current-change="handleCurrentChange" :current-page="form.index" :page-sizes="[1]"
                :disabled="loading || loadingdel" :page-size="form.size" :pager-count="12"
                layout="total, prev, pager, next, jumper" :total="total">
            </el-pagination>
        </div>
    </div>


</body>

</html>